<?php


namespace App\Models\StoreCenter\Models;


use App\Models\StoreCenter\StoreCenterModel;
use App\Models\UserModels\Models\MemberModel;

class CouponUserModel extends StoreCenterModel
{
    public $table = 'coupon_user';
    public $fillable = [
        'coupon_code',//'优惠券编码',
        'create_user', //用户,
        'create_user_uuid', //用户uuid,
        'count',//数量
        'status',//状态 1=使用 2=未使用
    ];

    public function userInfo()
    {
        return $this->belongsTo(MemberModel::class, 'uuid', 'uuid');
    }

    public function couponInfo()
    {
        return $this->belongsTo(CouponModel::class, 'code', 'coupon_code');
    }
}
